﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

using ImageRecognition2.Forms;
namespace ImageRecognition2.Action
{
    /// <summary>
    /// 
    /// </summary>
    public class ActionForm : AbstractFilterCommand
    {
        protected IFormFilter m_Form = null;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="_form"></param>
        public ActionForm(IFormFilter _form)
        {
            m_Form = _form;
        }

        /// <summary>
        /// Gets/sets filter form
        /// </summary>
        public IFormFilter Form
        {
            get { return m_Form; }
            set { m_Form = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void Run(object sender, EventArgs e)
        {
            m_Form.imgOriginal = (Bitmap)MainFormSingleton.ActivePictureBox.BackgroundImage.Clone();
            m_Form.PictureBox.BackgroundImage = (Image)m_Form.imgOriginal.Clone();
            m_Form.ShowDialog();
        }
    }
}
